home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / m4-1_0_3.lha / m4-1.0.3 / checks / check_them < prev    next >
Text File  |  1992-12-19  |  935b  |  50 lines

  1. #!/bin/sh
  2. # Check GNU m4 against examples from the manual source.
  3. # Copyright (C) 1992 Free Software Foundation, Inc.
  4.  
  5. out=/tmp/m4-out.$$
  6. err=/tmp/m4-err.$$
  7. xout=/tmp/m4-xout.$$
  8. xerr=/tmp/m4-xerr.$$
  9.  
  10. trap "rm -f $out $err $xout $xerr; exit 1" 1 2 3 14 15
  11.  
  12. for file
  13. do
  14.   echo "Checking $file"
  15.   ../m4 -d $file >$out 2>$err
  16.  
  17.   sed -e '/^dnl @result{}/!d' -e 's///' $file > $xout
  18.  
  19.   if cmp -s $out $xout; then
  20.     :
  21.   else
  22.     failed="$failed $file:out"
  23.     echo `sed -e 's/^dnl //' -e 1q $file`
  24.     echo "$file: stdout mismatch"
  25.     diff $out $xout
  26.   fi
  27.  
  28.   sed -e '/^dnl @error{}/!d' -e 's///' $file > $xerr
  29.  
  30.   if cmp -s $err $xerr; then
  31.     :
  32.   else
  33.     failed="$failed $file:err"
  34.     echo `sed -e 's/^dnl //' -e 1q $file`
  35.     echo "$file: stderr mismatch"
  36.     diff $err $xerr
  37.   fi
  38.  
  39. done
  40.  
  41. rm -f $out $err $xout $xerr
  42.  
  43. echo
  44. if test -z "$failed"; then
  45.   echo "All checks successful"
  46. else
  47.   echo "Failed checks were:"
  48.   echo " $failed"
  49. fi
  50.